package TEST3;

public class Vehicle {


        private String brand;
        private String color;
        private double speed;

        public Vehicle(String brand, String color) {
            super();
            this.brand = brand;
            this.color = color;
            this.speed = 0;
        }

        public Vehicle() {
            super();
        }

        public String getBrand() {
            return brand;
        }
        public String getColor() {
            return color;
        }
        public void setColor(String color) {
            this.color = color;
        }
        public double getSpeed() {
            return speed;
        }
        public void setSpeed(double speed) {
            this.speed = speed;
        }

        public void run() {
            System.out.println("品牌："+brand+" 颜色："+color+" 速度："+speed+"， 此车载人2人");
        }


        public static void main(String[] args) {
            Vehicle v1=new Vehicle("benz","black");
            v1.run();
        }

    }

public class Car extends Vehicle{
    int loader;

    public Car(int loader) {
        this.loader = loader;
    }

    public Car(String brand, String color, double speed,int loader) {
        super(brand, color);
        this.loader = loader;
        System.out.println(brand+","+color+","+loader);
    }

    public void run() {
        System.out.println("品牌："+getBrand()+" 颜色"+getColor());
        System.out.println("777777777");
    }

    public static void main(String[] args) {

        Car c2=new Car("Honda","red",0,2);
    }

}

